#define _CRT_SECURE_NO_WARNINGS 1
int getDecimalValue(struct ListNode* head) {
    struct ListNode* cur = head;
    int count = 0;
    int sum = 0;
    while (cur != NULL)
    {
        count++;
        cur = cur->next;
    }
    if (count == 1)
    {
        return head->val;
    }
    cur = head;
    while (cur->next != NULL)
    {
        count--;
        sum += pow((cur->val) * 2, count);
        cur = cur->next;
    }
    return sum + cur->val;
}